﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GNSWebSite.Managers;
using GNSWebSite.Settings;

namespace GNSWebSite.Controls
{
    public partial class PlaceOnMap : System.Web.UI.UserControl
    {
        #region Properties

        /// <summary>
        /// Returns latitude, placed on map
        /// </summary>
        public double Latitude
        {
            get
            {
                return Convert.ToDouble(hfLatitude.Value);
            }
        }

        /// <summary>
        /// Returns lontitude placed on map
        /// </summary>
        public double Longtitude
        {
            get
            {
                return Convert.ToDouble(hfLontitude.Value);
            }
        }


        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            //todo save changes 
            string script = string.Format("<script src='http://maps.google.com/maps?file=api&v=2&key={0}&hl=uk' " +
                   "type='text/javascript'></script>", GoogleMapSettings.MapApiKey);
            Page.ClientScript.RegisterStartupScript(typeof(Page), "script", script, false);
        }
    }
}